package com.netwit.web.controller;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletRequest;
import java.util.Enumeration;

@Controller
public class LoginController {

    private final Logger log = LoggerFactory.getLogger(LoginController.class);

    @RequestMapping("/login")
    public String login(HttpServletRequest request) {
        return "login";
    }

    private final void logHeaders(HttpServletRequest request) {
        Enumeration<String> headers = request.getHeaderNames();
        String name;
        while (headers.hasMoreElements()) {
            name = headers.nextElement();
            log.info(name + "'s value is " + request.getHeader(name));
        }
    }

}
